<template>
    <div>
        <navbar id="header"><div id="nav-header">商品分类</div></navbar>
        <div class="sort-content">
            <div class="all">进口鲜果</div>
            <div id="goods">
            <router-link :to="'/goods/smallsort/goodslist/'+33">查看全部商品 <i class="fa fa-angle-right big"></i></router-link>
            </div>
        </div>
        <div class="sort-content" id="sort-padding">
            <div class="sort-content-lineone"><div class="item" style="color:#999">分类下子分类</div></div>
            <div v-for="b in smallsortlist" :key="b">
                <div class="sort-content-lineone"><router-link :to="'/goods/smallsort/goodslist/'+b"><div class="item items">{{b}}</div></router-link></div>
            </div>
        </div>
        <div id="footers">
            <footers></footers>
        </div>
    </div>
</template>

<script>
import { mapState, mapGetters } from 'vuex';
import footers from "../components/footers"
import navbar from "../components/navbar"
export default{
    data:function(){
        return{
            smallsortlist:[]
        }
    },
    components: {
        navbar,
        footers
    },
    mounted () {
        // console.log(this.$route.params.abc);
        var params = {
            a:this.$route.params.abc
        }
        this.http.post("/api/smallsort/request",params)
        .then(res=>{
            this.smallsortlist = res.data.msg.smalltype;
        })
    }
}
</script>

<style scoped>
a{
    text-decoration: none;
    color: #666;
}
#header{
    width: 100vw;
}
#nav-header{
    line-height: 37px;
    width: 60vw;
    text-align: center; 
}
.sort-content{
    background-color: #f2f2f2;
}
.all{
    margin-top: 37px;
    font-size: 14px;
    height: 45px;
    line-height: 45px;
    font-weight: bold;
    border-bottom: 1px solid #DDD;
    padding: 0 10px;
}
.sort-content-lineone{
    width: 100vw;
    position: relative;
}
.item{
    height: 37px;
    line-height: 37px;
    width: 80vw;
    margin: 0 auto;
    font-size: 14px;
    text-align: center;
}
.items{
    width: 80vw;
    height: 37px;
    background-color: white;
    border: solid 1px #ddd;
    color: #666;
    margin-top: 10px;
}
#footers{
    margin-top: 50px;
}
#sort-padding{
    padding-bottom: 30px;
}
.text{
    position: absolute;
    right: 12vw;
    z-index: 100;
    top: 2vw;
}
#goods{
    position: absolute;
    top: 48px;
    font-size: 14px;
    right: 2vw;
    color: #666;
}
.big{
    font-size: 20px;
}
</style>